home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 45 / PC Gamer IT CD 45 2-2.iso / FLEET / data1.cab / Doctrines_Files / SubAtkSub.txt < prev    next >
Text File  |  1999-07-22  |  3KB  |  156 lines

  1. TITLE SubAtkSubDef
  2.  
  3. ; Timer 1 : TMA Leg timer
  4. ; Var 1      : Min firing range
  5. ; Var 2   : Store speed before changing it
  6. ; Var 3   : Closing speed calculation
  7. ; Var 4      : 0 = Closing target, 1 = Receding target 
  8. ; Var 5   : Oblique approach angle
  9. ; Var 6      : priority of this action
  10. ; Var 7      : indicates if we did a shot already at active pinger
  11.  
  12. RULE Randomize firing range
  13. IF INIT = 1 THEN
  14.     VAR_SET 1 {3500,6000}
  15.     VAR_SET 6 200
  16.     VAR_SET 7 0
  17. ELSE
  18.     
  19.     RULE let sub attack sub
  20.     IF VAR6 > 0 THEN
  21.         ;if the guy is actively pinging us, then lets waste him!
  22.         RULE attack active intercept
  23.         IF SOURCE = "Active Intercept" AND VAR7 = 0 THEN
  24.             DEBUG "Attacking Active Ping"
  25.             ATTACK_BEST
  26.             VAR_SET 7 1
  27.         ELSE
  28.             PRIORITY VAR6
  29.             RULE Store current speed
  30.             IF NEWTRACK = 1 THEN
  31.                 VAR_SET 2 SPD
  32.             END
  33.  
  34.             RULE Avoid Friendly
  35.             IF ID = FRIEND OR ID = UAF THEN
  36.                 DONE
  37.                 DEBUG "AVOID FRIENDLY!"
  38.                 TACTIC SubAvoidSub
  39.             END
  40.  
  41.             RULE ID
  42.             IF ID = UPD THEN
  43.                 DEBUG "UPD!"
  44.                 PRIORITY VAR6
  45.                 VAR_SET 5 BRG
  46.                 RULE New Leg
  47.                 IF TIMER3 = -1 THEN
  48.                     DEBUG "Silos:"
  49.                     DEBUG SILOS
  50.                     RULE Approaching?
  51.                     IF SILOS > 0 THEN
  52.                         DEBUG "UPD Opening Pursuit"
  53.                         VAR_SET 4 1
  54.                         VAR_SET 3 OWNSPD
  55.                         VAR_ADD 3 SILOS
  56.                         VAR_ADD 3 {3,5}
  57.                     ELSE
  58.                         DEBUG "UPD Approaching Leg"
  59.                         VAR_SET 4 0
  60.                         VAR_SET 3 {6,8}
  61.                         VAR_SET 5 BRG
  62.                         RULE Compute oblique angle for leg
  63.                         IF AOB < 0 THEN
  64.                             VAR_SUB 5 {30,60}
  65.                         ELSE
  66.                             VAR_ADD 5 {30,60}
  67.                         END
  68.                     END
  69.                     SET_TIMER 3 {300,420}
  70.                 END
  71.  
  72.                 RULE Proceed on leg, or pursue
  73.                 IF VAR4 = 0 THEN
  74.                     DEBUG "Proceed on Leg to UPD"
  75.                     PRIORITY VAR6
  76.                     SETCRS VAR5
  77.                 ELSE
  78.                     DEBUG "pursue to UPD"
  79.                     PRIORITY VAR6
  80.                     STEER_TO
  81.                 END
  82.  
  83.                 RULE Minimum speed
  84.                 IF VAR3 < 4 THEN
  85.                     VAR_SET 3 4
  86.                 END
  87.                 PRIORITY VAR6
  88.                 SETSPD VAR3            
  89.             END
  90.             RULE ID Hostile        
  91.             IF ID = HOSTILE OR ID = UAE THEN
  92.                 DEBUG "Hostile!"
  93.                 VAR_SET 5 BRG
  94.                 RULE New Closing Leg
  95.                 IF RNG > VAR1 AND TIMER1 = -1 THEN
  96.                     DEBUG "Silos:"
  97.                     DEBUG SILOS
  98.                     RULE Approaching?
  99.                     IF SILOS > 0 THEN
  100.                         DEBUG "Hostile Opening Pursuit"
  101.                         VAR_SET 4 1
  102.                         VAR_SET 3 OWNSPD
  103.                         VAR_ADD 3 SILOS
  104.                         VAR_ADD 3 {3,5}
  105.                     ELSE
  106.                         DEBUG "Hostile Approaching Leg"
  107.                         VAR_SET 4 0
  108.                         VAR_SET 3 {6,8}
  109.                         VAR_SET 5 BRG
  110.                         RULE Compute oblique angle for leg
  111.                         IF AOB < 0 THEN
  112.                             VAR_SUB 5 {30,60}
  113.                         ELSE
  114.                             VAR_ADD 5 {30,60}
  115.                         END
  116.                     END
  117.                     SET_TIMER 1 {480,600}
  118.                 END
  119.  
  120.                 RULE Proceed on leg, or pursue
  121.                 IF VAR4 = 0 THEN
  122.                     DEBUG "Proceed on Leg to Hostile"
  123.                     PRIORITY VAR6
  124.                     SETCRS VAR5
  125.                 ELSE
  126.                     DEBUG "Pursue Hostile"
  127.                     PRIORITY VAR6
  128.                     STEER_TO
  129.                 END
  130.  
  131.                 RULE Minimum speed
  132.                 IF VAR3 < 4 THEN
  133.                     VAR_SET 3 4
  134.                 END
  135.                 PRIORITY VAR6
  136.                 SETSPD VAR3            
  137.  
  138.                 RULE Attack
  139.                 IF ( RNG < 6000 AND CONF > 40 ) OR 
  140.                    RNG < VAR1 OR 
  141.                    ( CONF > 60 AND SILOS > 0 ) THEN
  142.                     DEBUG "Attack Best Hostile"
  143.                     PRIORITY VAR6
  144.                     ATTACK_BEST
  145.                 END
  146.             END
  147.  
  148.             RULE PostLaunch
  149.             IF WEAPON_AWAY = 1 THEN
  150.                 DEBUG "Avoid after shooting"
  151.                 TACTIC SubAvoidSub
  152.             END
  153.             END ;if not active ping
  154.          END ;let sub engage
  155. END
  156.